#include <torch/extension.h>

inline void test(torch::Tensor input1,torch::Tensor input2,torch::Tensor output){
    int rows = output.size(0);
    int cols = output.size(1);
    const float* const data1_ptr = input1.data_ptr<float>();
    const float* const data2_ptr = input2.data_ptr<float>();
    float* const data_ptr = output.data_ptr<float>();
    for(int i=0;i<rows;i++){
        for(int j=0;j<cols;j++){
            *(data_ptr+i*cols+j) = *(data1_ptr+i*cols+j)+*(data2_ptr+i*cols+j);
        }
    }
    return ;
}

PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
  m.def("test", &test, "test");
}


